package com.cn.aop.xml;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

public class XAspect {
	@Pointcut("execution(* com.cn.aop..AP.*(..))")
    private void anyMethod(){}
	@Before("anyMethod()")
	public void doBefore(JoinPoint p){
		XApoint a = (XApoint) p.getTarget();
		System.out.println("my test before,param is"+a.str);
	}
	/*@Around("anyMethod()")
	public void doArround(ProceedingJoinPoint pjp){
		System.out.println("my test start");
		try {
			pjp.proceed();
		} catch (Throwable e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		System.out.println("my test over");
	}*/
}
